home *** CD-ROM | disk | FTP | other *** search
/ QuickTime - The Beta Release / QuickTime - The Beta Release.iso / Programming Stuff / Interfaces / Movies Interfaces / ImageCodec.h < prev    next >
Text File  |  1991-09-06  |  6KB  |  247 lines

  1. /*
  2.     File:        Image Codec.h
  3.     Contains:    Image Compressor/Decompressor definitions
  4.     Copyright:    © 1991 by Apple Computer, Inc., all rights reserved.
  5. */
  6.  
  7.  
  8. #ifndef    __CODECGUTS__
  9.  
  10. #define    __CODECGUTS__
  11.  
  12. #include    <Types.h>
  13. #include    <Memory.h>
  14. #include    <SysEqu.h>
  15. #include    <QuickDraw.h>
  16. #include    <Errors.h>
  17. #include    <QDOffscreen.h>
  18.  
  19. #include    "ImageCompression.h"
  20.  
  21. #ifdef    CODEC_MGR_VERSION
  22. #if    CODEC_MGR_VERSION    != 15
  23.     WRONG CODEC_MGR_VERSION
  24. #endif
  25. #endif
  26.  
  27.  
  28.  
  29. /*    codec component selectors    */
  30.  
  31. #define    codecGetCodecInfo                    0x00
  32. #define    codecGetCompressionTime                0x01
  33. #define    codecGetMaxCompressionSize            0x02
  34. #define    codecPreCompress                    0x03
  35. #define    codecBandCompress                    0x04
  36. #define    codecPreDecompress                    0x05
  37. #define    codecBandDecompress                    0x06
  38. #define    codecCDSequenceBusy                    0x07
  39. #define    codecGetCompressedImageSize            0x08
  40. #define    codecGetSimilarity                    0x09
  41. #define    codecTrimImage                        0x0a
  42.  
  43. /*    codec selectors 0-127 are reserved by Apple */
  44. /*    codec selectors 128-191 are subtype specific */
  45. /*    codec selectors 192-255 are vendor specific */
  46. /*    codec selectors 256-32767 are available for general use */
  47. /*    negative selectors are reserved by the Component Manager */
  48.  
  49.  
  50.  
  51. /*    codec capabilities flags    */
  52.  
  53. #define    codecCanScale                        (1L<<0)
  54. #define    codecCanMask                        (1L<<1)
  55. #define    codecCanMatte                        (1L<<2)
  56. #define    codecCanTransform                    (1L<<3)
  57. #define    codecCanTransferMode                (1L<<4)
  58. #define    codecCanCopyPrev                    (1L<<5)
  59. #define    codecCanSpool                        (1L<<6)
  60. #define    codecCanClipVertical                (1L<<7)
  61. #define    codecCanClipRectangular                (1L<<8)
  62. #define    codecCanRemapColor                    (1L<<9)
  63. #define    codecCanFastDither                    (1L<<10)
  64. #define    codecCanSrcExtract                    (1L<<11)
  65. #define    codecCanCopyPrevComp                (1L<<12)
  66. #define    codecCanAsync                        (1L<<13)
  67. #define    codecCanMakeMask                    (1L<<14)
  68. #define codecCanShift                        (1L<<15)
  69.  
  70.  
  71. typedef    struct {
  72.     long    flags;
  73.     short    wantedPixelSize;
  74.     short    extendWidth;
  75.     short    extendHeight;
  76.     short    bandMin;
  77.     short    bandInc;
  78.     short    pad;
  79.     unsigned long    time;
  80. } CodecCapabilities;
  81.  
  82.  
  83.  
  84. /*    codec condition flags    */
  85.  
  86. #define    codecConditionFirstBand                (1L<<0)    
  87. #define    codecConditionLastBand                (1L<<1)    
  88. #define    codecConditionCodecChangedMask        (1L<<31)    
  89.  
  90.  
  91. #define    codecInfoResourceType        'cdci'            /* codec info resource type */
  92.  
  93.  
  94. typedef    struct {    
  95.     ImageSequence             sequenceID;                /* precompress,bandcompress */
  96.     ImageDescriptionHandle     imageDescription;        /* precompress,bandcompress */
  97.     Ptr                     data;
  98.     long                     bufferSize;
  99.     long                     frameNumber;
  100.     long                     startLine;
  101.     long                     stopLine;
  102.     long                    conditionFlags;
  103.     CodecFlags                 callerFlags;
  104.     CodecCapabilities         *capabilities;            /* precompress,bandcompress */
  105.     ProgressProcRecord        progressProcRecord;
  106.     CompletionProcRecord    completionProcRecord;    
  107.     FlushProcRecord         flushProcRecord;
  108.  
  109.     PixMap                     srcPixMap;                /* precompress,bandcompress */
  110.     PixMap                     prevPixMap;
  111.     CodecQ                     spatialQuality;
  112.     CodecQ                     temporalQuality;
  113.     Fixed                     similarity;
  114.     long                    reserved[2];
  115. } CodecCompressParams;
  116.  
  117.  
  118. typedef    struct {    
  119.     ImageSequence             sequenceID;                /* predecompress,banddecompress */
  120.     ImageDescriptionHandle     imageDescription;        /* predecompress,banddecompress */
  121.     Ptr                     data;
  122.     long                     bufferSize;
  123.     long                     frameNumber;
  124.     long                     startLine;
  125.     long                     stopLine;
  126.     long                    conditionFlags;
  127.     CodecFlags                 callerFlags;
  128.     CodecCapabilities         *capabilities;            /* predecompress,banddecompress */
  129.     ProgressProcRecord        progressProcRecord;
  130.     CompletionProcRecord    completionProcRecord;
  131.     DataProcRecord            dataProcRecord;
  132.  
  133.     CGrafPtr                 port;                    /* predecompress,banddecompress */
  134.     PixMap                     dstPixMap;                /* predecompress,banddecompress */
  135.     BitMapPtr                 maskBits;
  136.     PixMapPtr                 mattePixMap;
  137.     Rect                     srcRect;                /* predecompress,banddecompress */
  138.     MatrixRecord             *matrix;                /* predecompress,banddecompress */
  139.     CodecQ                     accuracy;                /* predecompress,banddecompress */
  140.     short                     transferMode;            /* predecompress,banddecompress */
  141.     long                    reserved[2];
  142. } CodecDecompressParams;
  143.  
  144.  
  145.  
  146. #ifdef    __CALLING_CODECS__
  147. #define    PREAMBLE    ComponentInstance ti
  148. #else
  149. #define    PREAMBLE    Handle    storage
  150. #endif
  151.  
  152. pascal ComponentResult
  153. CDGetCodecInfo(PREAMBLE,CodecInfo *info)
  154. #ifdef    __CALLING_CODECS__
  155.     = {0x2f3c,4,codecGetCodecInfo,0x7000,0xa82a};
  156. #else
  157. ;
  158. #endif
  159.  
  160. pascal ComponentResult
  161. CDGetCompressionTime(PREAMBLE,PixMapHandle src,Rect *srcRect, short depth,CodecQ *spatialQuality,
  162.     CodecQ *temporalQuality,unsigned long *time)
  163. #ifdef    __CALLING_CODECS__
  164.     = {0x2f3c,22,codecGetCompressionTime,0x7000,0xa82a};
  165. #else
  166. ;
  167. #endif
  168.  
  169. pascal ComponentResult
  170. CDGetMaxCompressionSize(PREAMBLE,PixMapHandle src,Rect *srcRect, short depth,CodecQ quality,long *size)
  171. #ifdef    __CALLING_CODECS__
  172.     = {0x2f3c,18,codecGetMaxCompressionSize,0x7000,0xa82a};
  173. #else
  174. ;
  175. #endif
  176.  
  177.  
  178. pascal ComponentResult
  179. CDPreCompress(PREAMBLE,CodecCompressParams *params)
  180. #ifdef    __CALLING_CODECS__
  181.     = {0x2f3c,4,codecPreCompress,0x7000,0xa82a};
  182. #else
  183. ;
  184. #endif
  185.  
  186. pascal ComponentResult
  187. CDBandCompress(PREAMBLE,CodecCompressParams *params)
  188. #ifdef    __CALLING_CODECS__
  189.     = {0x2f3c,4,codecBandCompress,0x7000,0xa82a};
  190. #else
  191. ;
  192. #endif
  193.  
  194. pascal ComponentResult
  195. CDPreDecompress(PREAMBLE,CodecDecompressParams *params)
  196. #ifdef    __CALLING_CODECS__
  197.     = {0x2f3c,4,codecPreDecompress,0x7000,0xa82a};
  198. #else
  199. ;
  200. #endif
  201.  
  202. pascal ComponentResult
  203. CDBandDecompress(PREAMBLE,CodecDecompressParams *params)
  204. #ifdef    __CALLING_CODECS__
  205.     = {0x2f3c,4,codecBandDecompress,0x7000,0xa82a};
  206. #else
  207. ;
  208. #endif
  209.  
  210. pascal ComponentResult
  211. CDCodecBusy(PREAMBLE,ImageSequence seq)
  212. #ifdef    __CALLING_CODECS__
  213.     =  {0x2f3c,4,codecCDSequenceBusy,0x7000,0xa82a};
  214. #else
  215. ;
  216. #endif
  217.  
  218.  
  219. pascal ComponentResult
  220. CDGetCompressedImageSize(PREAMBLE,ImageDescriptionHandle desc,Ptr data,long bufferSize, 
  221.     DataProcRecordPtr dataProc,long *dataSize)
  222. #ifdef    __CALLING_CODECS__
  223.     = {0x2f3c,20,codecGetCompressedImageSize,0x7000,0xa82a};
  224. #else
  225. ;
  226. #endif
  227.  
  228. pascal ComponentResult
  229. CDGetSimilarity(PREAMBLE,PixMapHandle src,Rect *srcRect,ImageDescriptionHandle desc,Ptr data,Fixed *similarity)
  230. #ifdef    __CALLING_CODECS__
  231.     = {0x2f3c,20,codecGetSimilarity,0x7000,0xa82a};
  232. #else
  233. ;
  234. #endif
  235.  
  236. pascal ComponentResult
  237. CDTrimImage(PREAMBLE,ImageDescriptionHandle Desc,Ptr inData,long inBufferSize, DataProcRecordPtr dataProc,
  238.     Ptr outData,long outBufferSize,FlushProcRecordPtr flushProc,Rect *trimRect,ProgressProcRecordPtr progressProc)
  239. #ifdef    __CALLING_CODECS__
  240.     = {0x2f3c,36,codecTrimImage,0x7000,0xa82a};
  241. #else
  242. ;
  243. #endif
  244.  
  245.  
  246. #endif    __CODECGUTS__
  247.